<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<input id="id" name="id" value="${addr.id}" hidden/>
<div class="form-group">
    <label class="col-sm-3 control-label">地区名称：</label>
    <div class="col-sm-8">
        <input id="addrName" name="addrName" type="text" class="form-control" required value="${addr.addrName}">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label">地区编码：</label>
    <div class="col-sm-8">
        <input id="addrCode" name="addrCode" type="text" class="form-control" required value="${addr.addrCode}">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label">上级地址：</label>

    <div class="col-sm-8">
        <select class="form-control m-b" name="parentAddr" id="parentAddr">
            <option value="0">-请选择-</option>
            <c:forEach items="${addressList}" var="address">
                <c:if test="${not empty addr.parent && addr.parent.id == address.id}">
                    <option value="${address.id}" selected="selected">&nbsp;${address.addrName}</option>
                </c:if>
                <c:if test="${empty addr.parent || addr.parent.id != address.id}">
                    <option value="${address.id}" >&nbsp;${address.addrName}</option>
                </c:if>
            </c:forEach>
        </select>
    </div>
</div>